package com.youshang520i.consuldiscoveryconsumer.filter;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;

/**
 * 使用feign提供的拦截器，对请求进行处理
 * @author youshang
 */
@Configuration
public class MyInterceptor  implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("Content-Type", "application/json");
        System.out.println("这是自定义请求拦截器");
    }
}
